function NPC_OnCombat(pUnit, event)
pUnit:RegisterEvent("NPC_onCombat", 3125, 0)
pUnit:RegisterEvent("GetclosestPlayer", 3125, 0)
end

function GetclosestPlayer(pUnit, Event)
end

function NPC_ON_KILL_TARGET(pUnit, event)
pUnit:RemoveEvents()
end

function NPC_OnDied(pUnit, event)
pUnit:RemoveEvents()
end


RegisterUnitEvent(3125, 1, "NPC_OnCombat")
RegisterUnitEvent(3125, 4, "NPC_OnDied")
RegisterUnitEvent(3125, 3, "NPC_OnDied")